package com.hyt.it.ogt.kq.main.api;


import com.hyt.exception.annotation.ThrowsAdvice;
import com.hyt.it.ogt.kq.common.bm.swagger.BmApiVersionConstant;
import com.hyt.it.ogt.kq.main.controller.base.BaseController;
import com.hyt.it.ogt.kq.service.gov.model.param.GatherStatusUpdateParam;
import com.hyt.it.ogt.kq.service.gov.model.param.GatherSubjectNumUpdateParam;
import com.hyt.it.ogt.kq.service.gov.service.IExamAfterGatherService;
import com.hyt.log.annotation.Log;
import com.hyt.swagger.ApiVersion;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiOperationSort;
import io.swagger.annotations.ApiSort;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 给考后的api接口
 * </p>
 *
 * @author huangyh
 * @since 2021-03-08
 */
@Api(tags = "44.考后API接口", value = "考后API接口")
@ApiSort(value = 44)
@RestController
@RequestMapping("/api/kh")
public class KhApi extends BaseController {

    @Resource
    IExamAfterGatherService iExamAfterGatherService;

    @ApiOperation(value = "44.1.1 汇总系统科目数更新")
    @ApiOperationSort(value = 1)
    @ApiVersion(group = BmApiVersionConstant.V2_4_11)
    @ThrowsAdvice(code = 31441101, print = "汇总系统科目数更新失败")
    @Log(module = "汇总数据管理", business = "汇总系统科目数更新")
    @RequestMapping(value = "/gatherSubjectNumUpdate", method = RequestMethod.POST)
    public void gatherSubjectNumUpdate(@RequestBody GatherSubjectNumUpdateParam param) {
        iExamAfterGatherService.gatherSubjectNumUpdate(param);
    }

    @ApiOperation(value = "44.1.2 汇总系统任务结果更新")
    @ApiOperationSort(value = 2)
    @ApiVersion(group = BmApiVersionConstant.V2_4_11)
    @ThrowsAdvice(code = 31441201, print = "汇总系统任务结果更新失败")
    @Log(module = "汇总数据管理", business = "汇总系统任务结果更新")
    @RequestMapping(value = "/gatherStatusUpdate", method = RequestMethod.POST)
    public void gatherStatusUpdate(@RequestBody GatherStatusUpdateParam param) {
        iExamAfterGatherService.gatherStatusUpdate(param);
    }
}
